Part Number Hot Search : 
UPD16707 D1151 74HC5 60ZFP TCA30505 74HC5 N25F80 2909CT
Product Description
Full Text Search
 

To Download TMC332 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 1 copyright ? 200 9 trinamic motion control gmbh & co. kg tmc33 2 C data sheet micro s tep s equencer with integrated pwm units for 2 - phase and 3 - phase motors with closed loop current regulator trinamic ? motion control gmbh & co. kg sternstra?e 67 d C 20357 hamburg germany www.trinamic.com 1 features the TMC332 is a high resolution micro step sequencer with integrated sine wave look - up table and integrated pwm units. the TMC332 can control both, 2 - phase stepper motors and 3 - phase stepper motors. the TMC332 has two a lternative step direction interfaces - a classical two wire step/direction interface and a spi step direction interface for the tmc428 driver chain. an internal micro step counter with programmable step width make s the handling of physical units comfortabl e. parameterizing the tmc428 and the TMC332 takes place over a common spi micro controller interface. ? micro step sequencer for smooth motion applications ? 2 - phase stepper motor control ? 3 - phase stepper motor control ? 9 bit pwm units ? 9 bit sine wave look - up table ? 8 bit pwm scaler ? 4 bit pwm sub - modulation for scaling quantization compensation ? programmable break - before - make timing ? classical two wire step direction interface ? driver chain step direction interface for tmc428 ? common spi interface for parameterizin g of TMC332 and tmc428 ? integrated current measurement adc (just two tlc374 , one lm324 and some rc required) ? integrated current regulation ? manual or automatic micro - / full step switching for higher speeds ? 16 mhz clock frequency ? operation with 3.3v compatible ios / 1 .5v core voltage ? available in fbga144 package
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 2 copyright ? 200 9 trinamic motion control gmbh & co. kg life support policy trinamic motion control gmbh & co. kg does not authorize or warrant any of its products for use in life support systems, without the specific written consent of trinamic mot ion control gmbh & co. kg. life support systems are equipment intended to support or sustain life, and whose failure to perform, when properly used in accordance with instructions provided, can be reasonably expected to result in personal injury or death . ? trinamic motion control gmbh & co. kg 200 9 information given in this data sheet is believed to be accurate and reliable. however no responsibility is assumed for the consequences of its use nor for any infringement of patent s or other rights of third parties which may result from its use. specifications subject to change without notice.
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 3 copyright ? 200 9 trinamic motion control gmbh & co. kg 2 table of contents 1 features ................................ ................................ ................................ ................................ ...... 1 2 table of contents ................................ ................................ ................................ ................... 3 3 table o f figures ................................ ................................ ................................ ...................... 4 4 table of tables ................................ ................................ ................................ ........................ 4 5 pinning ................................ ................................ ................................ ................................ .......... 5 5.1 p ackage o utlines and d imensions ................................ ................................ ......................... 7 5.1.1 TMC332 - bc - fine pitch bga package with 144 ball s (fbga144) ................................ . 7 6 general description ................................ ................................ ................................ .............. 8 6.1 c hipset c onfiguration o utlines ................................ ................................ ............................ 9 7 application circuit notes ................................ ................................ ................................ .. 10 7.1 spi chain details ................................ ................................ ................................ .................... 10 7.2 g ate control output p olarity (ph, pl pins ) ................................ ................................ ....... 10 7.3 e ncoder input pins ................................ ................................ ................................ ................ 10 7.4 c urrent regulation pi ns ................................ ................................ ................................ ...... 10 7.5 o ver current protecti on ................................ ................................ ................................ ..... 10 7.6 s tandalone pins ................................ ................................ ................................ ..................... 11 7.6.1 configuration input description ................................ ................................ ........................ 11 7.7 s chematics ................................ ................................ ................................ ............................. 13 7.8 s electing the externa l components ................................ ................................ ................... 14 8 register description ................................ ................................ ................................ ........... 15 8.1 spi communication exampl es ................................ ................................ ................................ 19 8.2 f ull initialization e xample ................................ ................................ ................................ .... 19 9 parameterizing the t mc332 ................................ ................................ ................................ 20 9.1 p osition counter (a ddress $00 to $02) ................................ ................................ ............... 20 9.1.1 additional notes ................................ ................................ ................................ ............... 20 9.1.2 example ................................ ................................ ................................ ........................... 20 9.2 m icro step width (a ddress $03 and $04) ................................ ................................ ............. 20 9.2.1 additional notes ................................ ................................ ................................ ............... 20 9.2.2 examples ................................ ................................ ................................ ......................... 20 9.3 pwm settings (a ddress $06 and $07) ................................ ................................ .................. 21 9.3.1 additional notes ................................ ................................ ................................ ............... 21 9.3.2 example ................................ ................................ ................................ ........................... 21 9.4 abn encoder interface (a ddress $09, $0a and $10 to $12) ................................ .............. 22 9.4.1 additional notes ................................ ................................ ................................ ............... 22 9.4.2 encoder constant ................................ ................................ ................................ ............. 22 9.4.3 encoder clear mode ................................ ................................ ................................ ........ 22 9.4.4 encoder compare registers ................................ ................................ .............................. 23 9.4.5 examples ................................ ................................ ................................ ......................... 23 9.5 c urrent measurement a nd current regulator (a ddress $0b to $0d) ............................ 23 9.5.1 addit ional notes ................................ ................................ ................................ ............... 25 9.5.2 example ................................ ................................ ................................ ........................... 26 9.6 a utomatic micro - / full step switching (a ddress $0e) ................................ ........................ 26 9.6.1 additional notes ................................ ................................ ................................ ............... 26 9.6.2 example ................................ ................................ ................................ ........................... 27 9.7 c alculation of rotati onal speed ................................ ................................ ......................... 27 9.7.1 example for high rotational speeds ................................ ................................ ................. 27 10 notation of number s ystems ................................ ................................ ........................ 28 11 revision history ................................ ................................ ................................ .................. 29
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 4 copyright ? 200 9 trinamic motion control gmbh & co. kg 3 table of figures figure 1: package outline drawing fbga144 C (jedec mo - 192 var dad - 1) ................................ ... 7 figure 2: TMC332 functional block diagram ................................ ................................ ......................... 8 figure 3: ou tline of a typical TMC332 setup with tmc428 and c ................................ ........................ 9 figure 4: outline of a TMC332 setup with tmc457 and c ................................ ................................ .. 9 figure 5: schematic with over current detection circuit ................................ ................................ ......... 13 figure 6: example layout with tmc603 ................................ ................................ ................................ 14 figure 7: effects of the encoder clear mode bits ................................ ................................ .................. 23 figure 8 - conversion start timing for current meaurement ................................ ................................ .. 24 figure 9 - TMC332 current regulation on two phase motors ................................ ................................ . 25 figure 10 - TMC332 current regulation on three phase motors ................................ ............................ 25 figure 11: full step chopper modes ................................ ................................ ................................ ...... 27 4 table of tabl es table 5 - 1: TMC332 - fg144 pinning ................................ ................................ ................................ ........ 6 table 5 - 2: dimensions of fbga144 (note: bsc = basis spacing between centers) ........................... 7 table 8 - 1: TMC332 register address mapping (read access) ................................ ............................... 15 table 8 - 2: TMC332 register address mapping (write access) ................................ .............................. 16 table 8 - 3: TMC332 functional register description ................................ ................................ ............... 18 table 9 - 1: description of the enc_clr_mode bits ................................ ................................ ................... 22
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 5 copyright ? 200 9 trinamic motion control gmbh & co. kg 5 pinning a single package variant ( bga fg 1 44 , 0.5mm pitch) is available for the TMC332. for proper operation, it is strongly recommended to connect all power and ground pins (3 . 3 v , 1 . 5 v , gnd). pin fg144 i/o description nrst f1 i low active reset input clk g1 i clock input nen h2 i low active enable input, nen='1' disables all gate control signals equivalent to ovc nscs m3 i low active spi chip select input of the TMC332 driven from c nscs_428 l4 i low active spi chi p select input driven from c to select the tmc428 sck m4 i serial data clock input driven from c sdi m5 i serial data input driven from c sdo_of_428 l6 i input driven by the sdo_c of the tmc428 sdo m6 o / z serial data output to c (from TMC332 or t mc428, depending on nscs / nscs_428) stp j1 i step pulse input (logical ored with internal step pulse via tmc428 spi driver chain) dir k1 i direction input (logical ored with internal step pulse via tmc428 spi driver chain) nscs_drv m8 i low active spi chip select input driven from tmc428 (driver by nscs_s) sck_drv l8 i serial data clock input driven from tmc428 (driven by sck_s) sdi_drv m7 i serial data input driven from tmc428 (driven by sdo_s) sdo_drv l7 o serial data output to tmc428 sdi_s or to n ext spi driver within chain (sdi) ph a4 i gate control high side, 0 : low active gate control / 1 : high active gate control pl b4 i gate control low side, 0 : low active gate control / 1 : high active gate control ovc_ph k12 i high side gate control ou tputs t1h, t2h, t3h, t4h on ovc condition ovc_pl k11 i low side gate control outputs t1l, t2l, t3l, t4l on ovc condition ovc_disable j11 i high active ovc input (from comparator output that is high on ovc condition) ovc_ndisable j12 i low active ovc inp ut (from comparator output that is low on ovc condition) ovc h11 o over current status ( 0 : no over current condition / 1 : over current condition) shaft a3 i direction of motion clockwise / counter clockwise, direction depends on motor nxy_uvw b3 i '0 ' : selects two phase stepper scheme '1' : selects three phase stepper scheme t1h a5 o t1h_y2 y2 deactivated (level depending on pl) t1l b5 o t1l_y2 deactivated (level depending on ph) t2h b6 o t2h_y1 y1 t3h_w w t2l c6 o t2l_y1 t3l_w t3h a7 o t3h_x 2 x2 t2h_v v t3l b7 o t3l_x2 t2l_v t4h b8 o t4h_x1 x1 t1h_u u t4l a9 o t4l_x1 t1l_u enc_a c1 i 3.3v input for incremental encoder signal a (a pull up - resistor might be required) enc_b d1 i 3.3v input for incremental encoder signal b (a pull up - res istor might be required) enc_n d2 i 3.3v input for incremental encoder signal n (a pull up - resistor might be required) enc_o _1 m2 o encoder compare output 1 enc_o _2 l3 o encoder compare output 2 enc_o _3 k4 o encoder compare output 3 rrc a11 o rc con trol for current measurement comp_adc b10 o rc control for current measurement/limiting comp_pwm a10 o rc control for current limiting cmp1p c11 i positive comparator input for phase y2 cmp1n c12 i negative comparator input for phase y2 cmp2p d11 i po sitive comparator input for phase w/y1 cmp2n d12 i negative comparator input for phase w/y1 cmp3p e11 i positive comparator input for phase v/x2 cmp3n e12 i negative comparator input for phase v/x2 cmp4p f11 i positive comparator input for phase u/x1 cmp4n f12 i negative comparator input for phase u/x1 stdby f3 i standby current enable (power down mode) standalone_en h6 i enable standalone mode (settings via sc_* inputs) sc_fs_cur_0 f9 i standalone mode configuration, fullstep mode current, bit 0 sc_fs_cur_1 g9 i standalone mode configuration, fullstep mode current, bit 1 sc_fs_thrs_0 e8 i standalone mode configuration, fullstep mode threshold, bit 0 sc_fs_thrs_1 f8 i standalone mode configuration, fullstep mode threshold, bit 1 sc_fs_thrs_2 g8 i standalone mode configuration, fullstep mode threshold, bit 2 sc_p_reg_cur_0 j9 i standalone mode configuration, current regulator target, bit 0 sc_p_reg_cur_1 k9 i standalone mode configuration, current regulator target, bit 1
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 6 copyright ? 200 9 trinamic motion control gmbh & co. kg sc_p_reg_p_0 h7 i stand alone mode configuration, current regulator p parameter, bit 0 sc_p_reg_p_1 h8 i standalone mode configuration, current regulator p parameter, bit 1 sc_pd_amount_0 e2 i standalone mode configuration, power down mode, bit 0 sc_pd_amount_1 e3 i standalone mode configuration, power down mode, bit 1 sc_phi_0 d9 i standalone mode configuration, phi setting (microstepping), bit 0 sc_phi_1 d10 i standalone mode configuration, phi setting (microstepping), bit 1 sc_pwm_ampl_0 j5 i standalone mode configuration , pwm amplitude , bit 0 sc_pwm_ampl_1 j6 i standalone mode configuration, pwm amplitude , bit 1 sc_pwm_ampl_2 k5 i standalone mode configuration, pwm amplitude , bit 2 sc_pwm_ampl_3 k6 i standalone mode configuration, pwm amplitude , bit 3 sc_sd_sel_0 g11 i standalone mode configuration, slow decay mode setting , bit 0 sc_sd_sel_1 g12 i standalone mode configuration, slow decay mode setting , bit 1 1v5 a8, c4, e1, e10, g3, h1, h5, h12, j7 1.5v core supply voltage (all pins have to be connected proper opera tion) 3v3 a2, b12, e 4, e6, e7, e9, h10, j3, l2, l5, l11, m10 3.3v io supply voltage (all pin have to be connected for proper operation) gnd a1, a6, a12, b2, b11, f2, f5, f6, f7, f10, g2, g5, g6, g7, k7, k10, l1, l10, l12, m1, m11, m12 ground (all pins have to be connected for proper operation) reserved b1, b9, c2, c3, c5, c7, c8, c9, c10, d3, d4, d5, d6, d7, d8, e5, f4, g4, g10, h3, h4, h9, j2, j4, j8, j10, k2, k3, k8, l9 , m9 not connected, may be used in the future do not connect table 5 - 1 : TMC332 - fg144 pinning
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 7 copyright ? 200 9 trinamic motion control gmbh & co. kg 5.1 package outlines and dimensions 5.1.1 TMC332 - bc - fine pitch bga package w ith 144 balls (fbga144) figure 1 : package outline drawing fbg a144 C (jedec mo - 192 var dad - 1) symbol dimensions in millimeters dimensions in inches min typ max min typ max a 1.35 1.45 1.55 a1 0.35 0.40 0.45 a2 0.65 0.70 0.75 aaa 0.12 b 0.45 0.50 0.55 bbb 0.25 c - 0.35 - ccc 0.35 d 12.80 13.00 13.20 d1 11.00 bsc d2 12.80 13.00 13.20 e 12.80 13.00 13.20 e1 11.00 bsc e2 12.80 13.00 13.20 e 1.00 table 5 - 2 : dimensions of fbga144 (note: bsc = basis spacing betwee n centers) a 1 b a l l p a d c o r n e r ( m a r k e d b y d o t a t t o p s i d e ) t o p v i e w 1 2 3 4 5 6 1 2 1 1 1 0 9 8 7 a b c d e f g h j k l m e / 4 d / 4 e / e 2 d / d 2 b o t t o m v i e w e 1 2 3 4 5 6 1 2 1 1 1 0 9 8 7 a b c d e f g h j k l m e 1 e d 1 / / c c c s i d e v i e w b d 1 / e 1 a 2 a a a a 1 c a b b b ?
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 8 copyright ? 200 9 trinamic motion control gmbh & co. kg 6 general description the functional block structure of the TMC332 is given by figure 2 . the TMC332 is equipped with two step direction interfaces processed by the micro step sequencer. the micro step width can be progr ammed in a wide range with a high resolution. together with the additional 32 bit position counter, one can easily realize stepping within physical units. the tmc428 step direction interface of the TMC332 is directly compatible to the driver chain interfac e of the tmc428. the other step direction interface is a classical two wire step direction interface. the p arameterizing of the TMC332 takes place via a separate four wire serial interface (spi) for micro controller access to the internal register (control logic / register bank). the integrated sine wave look up table (sin lut) can output either two sine wave s with a phase shift of 90 for two phase stepper motors or three sine waves with +/ - 120 phase shift for three phase stepper motors . the gate control block provides the gate control signals for the power stage half bridges , including programmable break - before - make timing and over current protection . pwm frequency and brake - befor e - make timing are programmable. incremental encoders with abn output can be connected to the TMC332 to evaluate the physical motor position. three output lines are available to trigger external actions when previously set encoder positions are reached. the TMC332 also contains a current measurement unit and a current regulator, r equiring only a few inexpensive external components . figure 2 : TMC332 functional block diagram g a t e c o n t r o l p w m ( x y / u v w ) s i n l u t ( x y / u v w ) s e q u e n c e r t m c 4 2 8 s p i d r i v e r c h a i n i n t e r f a c e s p i ( r e g i s t e r i n t e r f a c e ) c o n t r o l l o g i c / r e g i s t e r b a n k a b n d e c o d e r s t e p / d i r e c t i o n c u r r e n t m e a s u r e m e n t c o n t r o l u n i t ( i x , i y / i u , i v , i w / i r m s ) p c o n t r o l l e r c h o p s y n c p w m ( f s m o d e ) 3 e n c o d e r p o s i t i o n c o m p a r e u n i t s
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 9 copyright ? 200 9 trinamic motion control gmbh & co. kg 6.1 chips et configuration outlines figure 3 : outline of a typical TMC332 setup with tmc428 and c figure 4 : outline of a TMC332 setup with tmc45 7 and c tmc 332 tmc 428 c power stage driver chain spi spi spi t m c 3 3 2 t m c 4 5 7 c p o w e r s t a g e s t e p / d i r e c t i o n s p i s p i
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 10 copyright ? 200 9 trinamic motion control gmbh & co. kg 7 application circuit notes 7.1 spi chain details when using the tmc428 to drive the t mc332, the sdo line of the spi bus, leading to the microcontroller is shared between the TMC332 and the tmc428. usually t he tmc428 requires external logic if the spi bus has to be shared with other ics . to avoid another ic , the TMC332 includes logic which switches the sdo signal of the tmc428 through as long as the nscs428 input is low (active). in all other conditions, the line uses the sdo signal of the TMC332. this means that both chips are connected parallel with distinct chip select lines . that makes i t possible to send small datagrams either to the tmc428 or to the TMC332 instead of having to send a large datagram through a daisy chain of both chips. since it makes no sense to write the same data to both chips at once, only one chip select line should be active. if both chip select lines are active and data is transferred, both chips will evaluate the data but only the output of the tmc428 will be returned. if the step/direction input is used, the nscs_428 pin should be connected to 3.3v and the sdo_of_ 428 pin should be connected to gnd . when using a tmc428, the stp and dir p ins should be connected to gnd. 7.2 gate control output polarity (ph, pl pins) the ph and pl pins define the polarity of the high - respectively low - side - gates of the bridges. when using non inverting gate drivers and n - mosfets on the high side and the low side, both pins would be tied to 3.3v. if one of the pins sets the wrong polarity, both transistors in the bridge would be switched at once and most probably trigger the over current pr otection. if both polarities are inverted, the short circuit state would only last as long as the break - before - make delay and if this time is too short to trigger the over current protection, this would lead to a high power consumption in the bridge transi stors. 7.3 encoder input pins if no encoder is used in the application, the encoder input pins enc_a, enc_b and enc_n pins should be connected to either gnd or 3.3v . 7.4 current regulation pins if no current measurement/ regulation and no full step mode is needed in the application circuit (when the motor is only operated at low speeds) , the external current sensing parts can be omitted. in this case, the comparator inputs (cmp n p and cmp n n, with n = 1, 2, 3, 4) should be connected to gnd . if full step mode is need ed, all inputs should be connected together and should be high, as long as the motor current is too high (the bridges are turned on while no input is high, where cmp1p/n are not evaluated in three phase stepper mode and the phases are evaluated separately in two phase stepper mode). 7.5 over current protection an external signal, either created by another integrated circuit or by some discrete components can be used to detect over current conditions in the motor power path. the TMC332 provides two complementar y inputs, which disable the bridges immediately. this over current condition is not reset automatically but needs a spi datagram to be sent to the TMC332. the datagram contains the set o (clear over current condition) bit: $88 00 00 01 usually only one of the two inputs is used and the other is tied to gnd or 3.3v, to disable its function: over current signal active level ovc_disable ovc_ndisable low gnd signal high signal 3.3v the state of the high and low side outputs during an over current condition is defined by the ovc_ph and ovc_pl pins, which work equivalent to the ph and pl pins. the pin ovc is a representation of the over current flag in the register bank and can be used to trigger an interrupt in a microcontroller.
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 11 copyright ? 200 9 trinamic motion control gmbh & co. kg 7.6 standalone pins when using the standalone mode (external configuration), the standalone_en pin has to b e connected to 3.3v and the sc_* inputs have to be connected to 3.3v or gnd to set the needed values. the exact function of these pins is explained below. when using the classic c onfiguration mode via the spi bus, the standalone_en pin has to be connected to gnd. in standalone mode, t he sc_* inputs override so me settings in the register bank . 7.6.1 configuration input description the numbers of the inputs with the same name are the bit numbers, where bit 0 is the lsb. the binary value 0 represent s 0v/gnd and 1 represents 3.3v. sc_pwm_ampl_* the 4 bit value is used as the upper 4 bits of the 8 bit pwm_ampl value. the lower 4 bits are set to 1, resulting in 16 possible values from 15 to 2 55 in steps of 16 . sc_phi_* the four possible settings for phi are: sc_phi_ phi microstepping with 2 phase stepper 1 0 0 0 1 256x 0 1 4 64x 1 0 16 16x 1 1 64 4x sc_pd_amount_* the p ower down amount bits are the same as the stdby value in the regi ster bank but the reduced power setting is used as long as one of the inputs is set high. sc_pd_amount_ pwm_ampl / current regulator target 1 0 0 0 * 1 0 1 * 0.5 1 0 * 0.25 1 1 * 0.125 sc_p_reg_cur_* and sc_p_reg_p_* the current regulator is disabl ed as long as sc_p_reg_cur_0 and sc_p_reg_cur_1 are both 0. in other cases the current regulator is enabled and the p parameter selected with sc_p_reg_p_* is used . the regulator tolerance is set to 12.5% . sc_p_reg_cur_ current regulator target 1 0 0 0 d isabled 0 1 40 1 0 60 1 1 80 the p parameter is configured via the sc_p_reg_p inputs sc_p_reg_p_ p parameter equivalent setting in register bank 1 0 0 0 1/512 $00 08 0 1 1/256 $00 10 1 0 1/ 128 $00 20 1 1 1/ 64 $00 40
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 12 copyright ? 200 9 trinamic motion control gmbh & co. kg sc_fs_ thrs _* and sc_fs_ cur _* the manual/automatic full step switching is configured with the sc_fs_thrs_* inputs. sc_fs_thrs_ full step switching (threshold equivalent to register bank) 2 1 0 0 0 0 always off 0 0 1 $10 0 1 0 $20 0 1 1 $30 1 0 0 $40 1 0 1 $80 1 1 0 $c0 1 1 1 always on n ote that in always on mode the phi setting from the sc_phi_* inputs is still active, meaning that more than one step pulse (4/16/64/256) is needed to make the motor do one full step. the sc_fs_cur_* inputs configure the current setting in f ull step mode. sc_fs_cur_ setting equivalent to register bank 1 0 0 0 2 0 1 4 1 0 6 1 1 8 sc_sd_sel_* the slow decay configuration inputs have the same functionality as the sl_d bits in the register bank. sc_sd_sel_ setting equivalent to register b ank 1 0 0 0 no slow decay phase 0 1 50% slow decay phase 1 0 75% slow decay phase 1 1 87.5% slow decay phase
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 13 copyright ? 200 9 trinamic motion control gmbh & co. kg 7.7 schematics figure 5 : schematic with over current detection circuit figure 5 shows the external components of the TMC332 needed to drive a motor with current measurement/control and over current protection. not shown are the spi bus to access the register bank and the control hardware (tmc428 spi or step/direc tion interface). the over current detection circuit in the v m line switches at approximately 5a. 1 0 0 2 2 n f 1 0 0 k 1 0 0 k ? l m 3 2 4 c m p x p [ c 1 1 , d 1 1 , e 1 1 , f 1 1 ] c m p x n [ c 1 2 , d 1 2 , e 1 2 , f 1 2 ] ? t l c 3 7 4 1 m 1 5 0 k 2 7 c 1 n f r r c [ a 1 1 ] c o m p _ a d c [ b 1 0 ] c o m p _ p w m [ a 1 0 ] 1 k 1 k + v m t x h [ a 5 , b 6 , a 7 , b 8 ] t x l [ b 5 , c 6 , b 7 , a 9 ] r s e n s e 0 . 1 / 1 w m o t o r e n c o d e r ( o p t i o n a l ) e n c _ a [ c 1 ] e n c _ b [ d 1 ] e n c _ n [ d 2 ] g a t e d r i v e r n e e d e d o n c e p e r m o t o r t e r m i n a l 3 t i m e s f o r 3 p h a s e m o t o r 4 t i m e s f o r 2 p h a s e m o t o r 0 , 1 / 1 w 1 k 1 0 0 n f / 5 0 v 4 7 k 1 0 k 1 0 k + 3 v 3 b c 8 4 6 b b c 8 5 6 b o v c _ n d i s a b l e [ j 1 2 ] n u m b e r s i n b r a c k e t s a r e t h e p i n n u m b e r s o f t h e t m c 3 3 2 + 3 v 3 + 3 v 3 ? t l c 3 7 4 t h e s u p p l y v o l t a g e f o r t h e l m 3 2 4 a n d t h e t l c 3 7 4 i s 3 . 3 v r 1 r 2 r 3
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 14 copyright ? 200 9 trinamic motion control gmbh & co. kg figure 6 : example layout with tmc603 when using the tmc603 as gate driver, the parts for the over current protection can be omitted as the signal is provided by the tmc603 . one tmc603 is able to drive 3 half bridges, which is enough for a three phase motor. for a two phase motor, two tmc603 are required, where every tmc603 drives the half bridges of one motor phase. in that case the error outputs of the two tmc603 are both connected to the ovc_ndisable pin. 7.8 selecting the external components for different current requirements, the values of the external components can be adapted. the best way is to change the value of the sense resistor. for good regulation results, the target current value should be a round 80 but not higher than 90 . with a two phase motor, this equals a charging time of about 10 s for the capacitor c. with the values in the example layouts (r2 = 150k, c = 1nf), th is results in a voltage of 0.22 v. with a n 1a (rms) motor, a 0.15 ohm sense resistor would create a 0.21v sense voltage at 1.41a peak phase current. for three phase motors the charging time should be about 8.125s, so the voltage is at 0.18v. with a 6a three phase motor, a 0.033 ohm sense resistor would create 0.198v sense voltage. the operational amplifiers and the comparators can be different parts than lm324 and tlc374 , but care should be taken with the comp arators as they should hav e a low input bias current. 1 0 0 2 2 n f 1 0 0 k 1 0 0 k ? l m 3 2 4 c m p 1 p [ c 1 1 ] c m p 2 p [ d 1 1 ] c m p 3 p [ e 1 1 ] c m p 4 p [ f 1 1 ] c m p 1 n [ c 1 2 ] c m p 2 n [ d 1 2 ] c m p 3 n [ e 1 2 ] c m p 4 n [ f 1 2 ] ? t l c 3 7 4 ? t l c 3 7 4 1 m 1 5 0 k 2 7 c 1 n f r r c [ a 1 1 ] c o m p _ a d c [ b 1 0 ] c o m p _ p w m [ a 1 0 ] 1 k + v m t 1 h [ a 5 ] t 1 l [ b 5 ] r s e n s e 0 . 1 / 1 w m o t o r e n c o d e r ( o p t i o n a l ) e n c _ a [ c 1 ] e n c _ b [ d 1 ] e n c _ n [ d 2 ] n e e d e d o n c e p e r m o t o r t e r m i n a l 3 t i m e s f o r 3 p h a s e m o t o r 4 t i m e s f o r 2 p h a s e m o t o r o v c _ n d i s a b l e [ j 1 2 ] n u m b e r s i n b r a c k e t s a r e t h e p i n n u m b e r s o f t h e t m c 3 3 2 2 x t m c 6 0 3 ( 1 x f o r 3 p h . m o t o r ) 2 2 0 z e n e r 1 2 v f o r e a c h m o t o r p h a s e t 2 h [ b 6 ] t 2 l [ c 6 ] t 3 h [ a 7 ] t 3 l [ b 7 ] t 4 h [ b 8 ] t 4 l [ a 9 ] t 1 h a n d t 1 l o n l y f o r t w o p h a s e m o t o r s / e r r _ o u t + 3 v 3 + 3 v 3 1 k t h e s u p p l y v o l t a g e f o r t h e l m 3 2 4 a n d t h e t l c 3 7 4 i s 5 v r 1 r 2 r 3
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 15 copyright ? 200 9 trinamic motion control gmbh & co. kg 8 register description the TMC332 is equipped with a set of registers for parameterizing . an overview of the registers is given in table 8 - 2 : TMC332 register address mapping and the detailed explanation f ollows in table 8 - 3 : TMC332 functional register description . $b1 describes the hexadecimal value of the first byte to send to the TMC332. it contains the w bit which describes if data should be read (0) or written (1) followed b y the seven address bits %add . if the w bit is 1, the remaining 24 bits of the datagram contain the data that should be written to that address according to the table, if the w bit is 0 for reading data from the TMC332, the value of the remaining bits is n ot important (dont care). 32 bit datagram to sen d from a c to the TMC332 via pin sdi read access 3 1 3 0 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 1 9 1 8 1 7 1 6 1 5 1 4 1 3 1 2 1 1 1 0 9 8 7 6 5 4 3 2 1 0 $ b1 w %add data $ 00 0 0 0 0 0 0 0 0 x_l $01 0 0 0 0 0 0 0 1 x_h $03 0 0 0 0 0 0 1 1 phi_frac $04 0 0 0 0 0 1 0 0 phi_int $06 0 0 0 0 0 1 1 0 pwm_ampl $ 0 7 0 0 0 0 0 1 1 1 pwm _offs pwm _f bbm_dly $08 0 0 0 0 1 0 0 0 status (h=inhibit & o=ovc) h o $09 0 0 0 0 1 0 0 1 enc_count $0a 0 0 0 0 1 0 1 0 n $0b 0 0 0 0 1 0 1 1 i_u/i_ x 1 (adc4) i_v /i_ x 2 (adc3) i_w/i_ y 1 (adc2) $0c 0 0 0 0 1 1 0 0 i_y 2(adc1) limit err_u err_v err_w err_ y 2 i_abs: sqrt(i_u2+i_v2+i_w2) / sqrt(i_x2+i_y 2) $0 e 0 0 0 0 1 1 1 0 f $0f 0 0 0 0 1 1 1 1 type (332) version ( 2 00) $10 0 0 0 1 0 0 0 0 enc_comp_1 $11 0 0 0 1 0 0 0 1 enc_comp_2 $12 0 0 0 1 0 0 1 0 enc_comp_3 $b1 w %add data 3 1 3 0 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 1 9 1 8 1 7 1 6 1 5 1 4 1 3 1 2 1 1 1 0 9 8 7 6 5 4 3 2 1 0 table 8 - 1 : TMC332 register address mapping (read access)
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 16 copyright ? 200 9 trinamic motion control gmbh & co. kg 32 bit datagram to send from a c to the TMC332 via pin sdi write access 3 1 3 0 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 1 9 1 8 1 7 1 6 1 5 1 4 1 3 1 2 1 1 1 0 9 8 7 6 5 4 3 2 1 0 $b1 w %add data $80 1 0 0 0 0 0 0 0 x_l $81 1 0 0 0 0 0 0 1 x_h $82 1 0 0 0 0 0 1 0 dx $83 1 0 0 0 0 0 1 1 phi_frac $84 1 0 0 0 0 1 0 0 phi_int $85 1 0 0 0 0 1 0 1 not in use $86 1 0 0 0 0 1 1 0 sl_d st d by m st d by_timeout pwm_ampl $87 1 0 0 0 0 1 1 1 pwm _offs pwm _f bbm_dly $88 1 0 0 0 1 0 0 0 status & control (p=phi_wr & h=inhibit & o=ovc) p h o $89 1 0 0 0 1 0 0 1 b enc_acc_const_in t enc_acc_ const_frac $8a 1 0 0 0 1 0 1 0 c t enc_clr_mode $8b 1 0 0 0 1 0 1 1 not in use $8c 1 0 0 0 1 1 0 0 r targ_curr $8d 0 0 0 0 1 1 1 0 tolerance p_parameter $8e 1 0 0 0 1 1 1 0 d e s fs_targ_curr fs _thr $8f 1 0 0 0 1 1 1 1 not in use $90 1 0 0 1 0 0 0 0 enc_comp_1 $91 1 0 0 1 0 0 0 1 enc_comp_2 $92 1 0 0 1 0 0 1 0 enc_comp_3 $b1 w %add data 3 1 3 0 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 1 9 1 8 1 7 1 6 1 5 1 4 1 3 1 2 1 1 1 0 9 8 7 6 5 4 3 2 1 0 table 8 - 2 : TMC332 register address mapping (write access) the x_l and x_h registers together form a 32 bit wide position counter. the register dx holds the step width for the position counter. for each micro step, a 3 4 bit wide register accumulates the micro step position by an amount of phi where phi is composed by an integer part phi_int and a fractional part phi_frac. with this, one can realize non - integer micro stepping. the most significant 10 bits of the micro step pos ition register form the micro step pointer within the sine wave look - up table. the register pwm_ampl controls the scaling of the pwm. an additional control bit named 'm' is for selection of a pwm modulation that gives a higher resolution at low values of pwm_ampl. the pwm_f register controls the pwm frequency and the bbm_dly controls the brake - before - make timing. the status and control register bits named 'p', 'h' are for enabling of the micro step counters to keep them consistent under every condition. t he status bit 'o' indicates an over current condition. the version of the TMC332 can be read out via a dedicated register.
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 17 copyright ? 200 9 trinamic motion control gmbh & co. kg addr r/w register bit (s) functional description $00 r position low x_l read lower 24 bits of 32 bit physical position counter x, 1st read x_l followed by read x_h to get a consistent 32 bit position w set lower 24 bits of 32 bit physical position counter x $01 r position high x_h read higher 8 bits of 32 bit physical position counter x, 1st read x_l before you read x_h to get a consistent 32 bit position w set higher 8 bits of 32 bit physical position counter x $02 w position step width dx write the dx register, the value dx is added or substracted with each step according to the direction input $03 r/w micro step width , fractional part phi_frac 24 bit wide fractional part of the of the micro step width $04 r/w micro step width, integer part phi_int 10 bit wide integer part of the micro step width $06 r pwm amplitude pwm_ampl read pwm amplitude w m enable pwm sub - mo dulation sl_d s low d ecay between pwm polarity changes sl_d = % 00 : no slow decay phase sl_d = % 01 : t*1/2 slow decay phase sl_d = % 10 : t*3/4 slow decay phase sl_d = % 11 : t*7/8 slow decay phase stdby pwm amplitude/ current during power down mode st dby = %00 : 100% of normal value stdby = %01 : 50% of normal value stdby = %10 : 25% of normal value stdby = %11 : 12.5% of normal value stdby_timeout delay between last full step and power down activation: delay [s] = (stdby_timeout * 1048576) / f_clk [hz] pwm_ampl set pwm amplitude pwm_ampl is used as the upper limit if the current regulator is active $07 r/w pwm control pwm_offs pwm offset ; adds an offset to the pwm values to create steeper zero crossings of the current wave pwm_f pwm frequen cy [hz] = f_clk[hz] / ((pwm_f+1)*2 10 ) bbm_dly break before make delay time [s] = 2^( bbm_dly+1) / f_clk[hz] $08 r/w status & control p phi register write bit (change of phi) p = 0 : leave phi untouched p = 1 : update phi := phi_int & phi_frac (write o nly bit, read always '0') h inhibit step direction interfaces (no count x_h, x_l, phi_int, phi_frac) h = 1 : inhibit stp / dir (and tmc428_drv interface) h = 0 : enable stp / dir (and tmc428_drv interface) o over current status bit o = 1 : over cur rent condition (read) / reset ovc (write) o = 0 : no over current condition $09 r encoder counter enc_count 24 bit wide encoder counter w encoder step width b i nterpret fractional part normally ( enc_acc_const_frac/16 ) when 0 or de c imal ( enc_acc_const_fr ac/10 ) when 1 enc_acc_ const_int 9 bit wide integer part of the encoder constant enc_acc_ const_frac 4 bit wide fractional part of the encoder constant $0a r encoder status n encoder is cleared at the next clear condition w encoder control c man ual reset of enc_count t trigger reset of enc_count via bit 5 of cm
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 18 copyright ? 200 9 trinamic motion control gmbh & co. kg enc_clr_mode clear mode (see 9.4.3 encoder clear mode ) $0b r current register 1 i_u measured current of terminal u or x1 i_v measured current of terminal v or x2 i_w measured current of terminal w or y1 $0c r current register 2 i_y2 measured current of terminal y2 limit pwm amplitude limited by regulator err_u error flag of bridge 4 (u/x 1) err_v error flag of bridge 3 (v/x2) err_w error flag of bridge 2 (w/y2) err_y2 error flag of bridge 1 i_abs calculated absolute current for two phase stepper motors with nxy_uvw=0 the TMC332 uses i_a = i_x1 or i_a = i_x2 and i_b = i_y1 o r i_b = i_y2 to calculate the absolute current i_abs = sqrt(i_a 2 + i_b 2 ). for three phase stepper motors with nxy_uvw=1 the TMC332 uses i_u, i_v and i_w to calculate the absolute current i_abs = sqrt(i_u 2 + i_v 2 + i_w 2 ). w current reg. control r activat e current regulator targ_curr target current of the regulator (compared with i_abs) $0d w current reg. param tolerance tolerance setting of the current regulator: %000 C C C C C C table 8 - 3 : TMC332 functional register description
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 19 copyright ? 200 9 trinamic motion control gmbh & co. kg 8.1 spi communication examples some examples show the communication to access the register bank. read out the type and version of the chip: send receive comment $0f 00 00 00 $00 33 2 2 00 the received type and version of the chip are: TMC332 v 2 .00 set the micro step width to 4 .25 : send receive comment $84 00 00 04 $00 00 00 00 set phi_int to 4 $83 40 00 00 $ 00 00 00 00 set phi_frac to $40000000 (= 0.25 * 16777216) clear the position counter: send receive comment $80 00 00 00 $00 00 00 00 clear lower 24 bits $81 00 00 00 $00 00 00 00 clear higher 8 bits 8.2 full initialization example this example shows ho w to initialize the TMC332 for use with a three phase stepper motor with 600 full steps per revolution which should have 36000 micro steps per revolution ( 1 / 100 degrees per micro step , 60 micro steps per full step) , active current regulation and an encoder with 2000 pulses per revolution that should count the micro steps . the position counter should count 1/10 micro steps . the detailed explanation of the settings and their calculation follows in chapter 9 ( paramete rizing the TMC332 ) . datagram to send description $80 00 00 00 reset position counter $81 00 00 00 $8 2 00 00 0a set dx to 1 0 $83 d8 2d 83 set phi_ frac to 14167427 phi := 2.8444444 $84 00 00 0 2 set phi_int to 2 $8d 02 00 1e parameterize the current regulator $8c 00 01 5 0 enable the current regulator with target value 80 $86 01 00 ff set the pwm limit to 255 $89 00 01 2 0 encoder constant := 18 $8a 0 0 05 a8 reset encoder counter now and on every falling edge of the n sign al
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 20 copyright ? 200 9 trinamic motion control gmbh & co. kg 9 paramete rizing the TMC332 9.1 position counter (address $00 to $02) with each step pulse, the 32 bit wide position counter x accumulates according to x := x + dx. the dx has to be set corresponding to a choice of the micro step width (see 9.2 ) to count positions within physical units. 9.1.1 additional notes since the position counter has an integer value, the unit of measurement has to be changed to avoid rounding errors. one way is to change the units prefix, e.g. if one step pulse is equal t o a linear motion of 0.25 m, one could use nm instead of m and set dx to 250. this will of course reduce the distance between two counter overflows from about 4 km to 4 m. 9.1.2 example for example, if one micro step is equal to 1 m for a given value of phi_ int an phi_frac and the dx is set to 1, the x resp. x_h and x_l represent the position within unit m. changing the phi_int and phi_frac in a way that one micro step is equal to 10 m would require to set dx to 10. with this, the position would still be wi thin the unit m. 9.2 micro step width (address $03 and $04) with the configurable micro step width, the rotational angle of one micro step can be set to a value that is optimized for a special application. with each step pulse, the 34 bit wide micro step an gle phi is accumulated according to phi : = phi + (phi_int + phi_frac / 2 24 ). the upper 10 bits of phi represent the micro step position within an electrical period. one electrical period contains 1024 values. for two phase stepper motors, one electrical pe riod is equal to four full steps. for three phase stepper motors, one electrical period is equal to six full steps. the fractional part phi_frac allows micro stepping with non - integer micro step widths. to calculate phi_sum the following formula can be u sed: phi _sum = (fs r /fs p ) * (1024/pos r ) fs r is the number of full steps in one revolution of the motor fs p is the number of full steps in one electrical period (4 or 6, see above) pos r is the needed number of positions in one revolution of the motor to g et phi_int and phi_frac, phi_sum has to be split up: phi_int is directly the integer part of phi_sum, phi_frac is the fractional part of phi_sum multiplied with 2 24 . 9.2.1 additional notes phi_sum should never be set to a value larger than 256 to avoid aliasing effect s . the only exception to this is when updating phi itself (using the p bit in register $88), which has to be done when the motor is stopped ( although it will probably move by the fraction of one fullstep when changing phi) . to update phi itself, one as to set phi_int and phi_frac to the values, that should be written to phi ( $83 nn nn nn / $84 xx xn nn ), then send the datagram that updates phi ( $88 00 00 04 ) and finally set phi_int and phi_frac to the values representing the micro step width ( $83 nn nn nn / $84 xx xn nn ). due to the 1024 discrete values in the micro step table per electrical period, only the integer part of phi will be used when accessing the micro step table . the fractional part is only relevant when using micro step widths with a fr actional part, e.g. when setting both phi and phi_sum to 0.25, the values of phi during motion will be 0.00, 0.25, 0.50, 0.75, 1.00, 1.25, 1.50, 1.75, 2.00, 2.25, 2.50, 2.75 , ... for accessing the micro step table, only the integer parts will be used: 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 9.2.2 examples a two phase stepper motor with 200 full steps per revolution should reach 360 positions (1 degree apart): phi_sum = (200/4) * (1024/360) = 50 * 2.8444 = 142.2222 phi_int = 142 = $ 0 8e
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 21 copyright ? 200 9 trinamic motion control gmbh & co. kg phi_frac = 2 24 * 0.2222 = 37 28270 = $38e38e the datagrams sent to the TMC332 would be $83 38 e3 8e and $84 00 00 8e the same resolution for a 600 step three phase motor: phi_sum = (600/6) * (1024/360) = 100 * 2.8444 = 284.4444 phi_int = 284 = $11c phi_frac = 2 24 * 0.4444 = 745654 0 = $71c71c the datagrams sent to the TMC332 in this case would be $83 71 c7 1c and $84 00 01 1c another example could be a 600 step three phase motor driving a lead screw that moves 5mm per revolution. the desired positioning accuracy is 1m, which means 5000 positions per revolution are needed. phi_sum = (600/6) * (1024/5000) = 100 * 0.2048 = 20.48 phi_int = 20 = $ 0 14 phi _frac = 2 24 * 0.48 = 8053063 = $7ae147 the datagrams sent to the TMC332 in this case would be $83 7a e1 47 and $84 00 00 14 9.3 pwm settin gs (address $06 and $07) the pwm_ampl controls the level and direction of the current through the motor by modifying the maximum duty cycle of the pwm . the sub modulation bit m enables a finer resolution of the pwm by periodical changes of the pwm amplitud e . without current regulation, the pwm amplitude setting for a given current on a stopped two phase motor can be approximated. the required values are the supply voltage (v supply ) the resistance of one motor coil (r coil ) and the rms current value (i rms ) o r the peak current value (i peak ): pwm_ampl = i rms * 1.41 * r coil * 256 / v supply = i peak * r coil * 256 / v supply the pwm_offset parameter is used for fine tuning of the pwm sine curve to avoid short periods of zero current created by the bbm time . the pw m_f parameter can be used to reduce the pwm frequency . the original frequency of f clk /1024 - usually 15625 hz - i s divided by pwm_f +1 f pwm = f clk / (1024 * ( pwm_f + 1)) with the bbm_dly parameter, the break before make delay can be changed in the range o f 2/f clk (usually 1/8 s) to 2 16 /f clk (usually 4,096 ms) . the exact delay time can be calculated with the following formula: t dly = ( bbm_dly + 1) / f clk the optimal setting depends on the gate charge of the transistors and the gate driving current. an a pproximation for the value with given gate drivers and transistors can be made: bbm_dly = (q g / i g ) * f clk - 1 usually a slightly lower value can be chosen. the best setting can be found when no motor is connected, bbm_dly is set to 15 (the highest poss ible value) and the power consumption of the circuit is monitored. then the bbm_dly is lowered until the power consumption rises. the lowest value before the power consumption rises is the optimal setting for bbm_dly. the sl_d parameter is used for a conf igurable time of slo w decay on each polarity change. the percentage of normal current flow during each pwm cycle can be described as t on /t = 2 - sl_d . 9.3.1 additional notes generally the pwm frequency does not need to be changed; in most cases a lower frequency leads to audible vibrations in the motor. 9.3.2 example assuming the TMC332 is clocked with 16 mhz , a pwm with an amplitude of 42 ($2a) and no modulation, about 5 khz frequency and ~ 1 ms break before make delay should be set up.
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 22 copyright ? 200 9 trinamic motion control gmbh & co. kg the datagram to set up the ampli tude would be $86 00 00 2a and the frequency and break before make delay is set up with $87 00 02 0d . 9.4 abn encoder interface (address $09 , $0a and $10 to $12 ) with the abn encoder interface it is possible connect an abn encoder (quadrature encoder) to the TMC332 and read out the position with configurable step width via the spi interface. if the encoder has open collector outputs, external pull up resistors are needed . 9.4.1 additional notes the n - signal which usually indicates one position on the revolution can be used to reset the counter (see 9.4.3 encoder clear mode ). if no reset functionality is needed, t he n input should either be connected to gnd or 3. 3 v . if the encoder does not provide such a signal, a microcontroller can generate the n signal from any needed condition. even if the n input is unused , enc_count can be reset via spi. ( $8a xx 04 00 C t and enc_clr_mode are unused in that case) 9.4.2 encoder constant the encoder constant ( 9 bit wide integer par t enc_acc_cons_int , 4 bit wide fractional part enc_acc_cons_frac ) is added to an internal register with each encoder step. the integer part f rom this accumulation register can be read out as enc_count . additionally the fractional part is interpreted as dec imal when bit 13 (b) is set to 1. so the constant can be adjusted between 0 and 511 15/16 in binary mode (bit 13 = 0) and between 0 and 511 9/10 in decimal mode . 9.4.3 encoder clear mode bit 8 7 6 5 4 3 2 1 0 name cln nt n ntp neo nec ab_ig n_pol b_pol a_pol table 9 - 1 : d escription of the enc_clr_mode bits one way to reset the enc_count register is to send a datagram with the manual reset bit (bit 10 at address $8a) set. the datagram to do that is $8a xx 04 00 . th e advanced clear modes can be configured via the clear mode bits ( bits 8 0 at address $8a). the bit that always has to be set, to reset the counter using the n input is cln , which enables the reset function. ntn and ntp are used to determine, on which e dge of the n signal the counter should be reset. i f both bits are cleared (0), the active logic level (which is determined by n_pol ) of n triggers the reset , any edges of the a and b signals are ignored while n is active . i f ntp is set to 1 , the start of t he n condition triggers the reset. that means if n is low active, the falling edge of n is the start of the n condition . if n is high active, the rising edge of n is the start of the n condition. if ntn is set to 1, the end of the n condition triggers the reset. it is also possible to set both bits and reset the counter on both edges. neo makes it possible to reset the counter only on the next clear event. when this bit is set, writing a 1 to bit 9 ( t ) in the register, clears the counter on the next clear e vent. the combination of neo and level sensitive evaluation of n ( ntn = ntp = 0) acts the same way as neo combined with edge sensitive evaluation o f n responding to the first edge (falling if low active, rising if high active) . if nec is set, the counter i s cleared on every clear event, which would usually be once per revolution. to determine if the encoder counter will be cleared at the next clear event, the flag n in the encoder status register ($0a) can be read. if this bit is set, the next clear event w ill clear the encoder counter. if the nec bit is set, the n bit will always read 1. ab_ig disables the evaluation of the levels of a and b to determine if a clear event is triggered. when this bit is set, only the n signal is evaluated. n_pol describes the value of the n input that is interpreted as active. if n is active low , n_pol would be set to 0. the two lowest bits ( b_pol and a_pol ) define the logic level, the inputs b and a must have when the e dge (or state) of n trigger s a clear event. the followi ng diagrams illustrate the edge/level sensitivity controlled by the bits ntn and ntp and the difference between the neo and nec bits.
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 23 copyright ? 200 9 trinamic motion control gmbh & co. kg figure 7 : effects of the encoder clear mode bits the first four diag rams above show the n signal and the internal clear signal (clr) which resets enc_count to 0 when it is high for different settings of enc_clr_mode (shown below each diagram) . the reset occurs on every clear state of n ( nec is set) and regardless of the le vels of a and b ( ab_ig is set). the fifth diagram shows the use of neo , which resets enc_count only at the first clear condition after the t bit is set. the enc_clr_mode is set at the start of the diagram together with the t bit and the first falling edge of n resets enc_count . all of the following falling edges of n are ignored until the t bit is set again. 9.4.4 encoder compare registers the three encoder compare registers $10, $11 and $12 can be set to values that are compared to the encoder counter ( enc_coun t register). as long as the encoder counter equals one of the registers, the corresponding output ( enc_o _1 for enc_comp_1 , enc_o _2 for enc_comp_2 , enc_o _3 for enc_comp_3 ) is set. 9.4.5 examples encoder constant an encoder with 8000 pulses per revolution is used on a 200 steps/revolution motor and the microstepping is set to 1/4 (phi = 64) . the microsteps should be counted by the encoder . 10 encoder counts equal one microstep so the encoder constant is 0.1. this can be reached with the decimal mode by setting the b bit (bit 13) to 1, setting enc_acc_cons_int to 0 and enc_acc_cons_frac to 1. the complete datagram is $8 9 0 0 20 01. clear m ode the clear mode %110011000 clears ( cln ) the counter on each ( nec ) rising edge ( ntn , end of n condition ) of the low active ( n_p ol ) signal n , regardless of the logic level of a and b ( ab_ig ). the clear mode %101100111 clears ( cln ) the counter once on the first ( neo ) rising edge ( ntp , start of n condition ) of the high active ( n_pol ) signal n after t (bit 9) h as been set. additionall y a and b have to be high ( b_pol and a_pol ) , otherwise the counter is not reset. encoder flag with the setup from the encoder constant example above and the enc_flag parameter set to 2, the enc_flag pin toggles every 4 positions resulting in 1250 pin chan ges or 625 pulses per revolution 9.5 current measurement and current regulator (address $0b to $0d) measurement of the phase currents the TMC332 uses a single current sensing resistor for each motor driver half bridge. thus there are four sense resistors for two phase motors and three resistors for three phase motors. this allows a current measurement in each chopper state. each sense resistor is connected to a signal conditioning circuit, creating an interface to the TMC332 that can measure the voltage drop on all resistors in parallel. the conversions are started on certain points in the pwm period, once in the three phase stepper mode, twice in the two phase stepper mode. n % 1 0 0 0 1 1 0 0 0 c l r n % 1 1 0 0 1 1 0 0 0 c l r n % 1 0 1 0 1 1 0 0 0 c l r n % 1 1 1 0 1 1 0 0 0 c l r n % 1 0 1 1 0 1 0 0 0 c l r
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 24 copyright ? 200 9 trinamic motion control gmbh & co. kg figure 8 - c onversion start ti ming for current meaurement for calculation of the total current, at least two valid measurement results are required. in three phase mode, the third value can be easily determined by the knowledge that the sum of all three currents equals zero (i u +i v +i w = 0). in two phase mode, one current value of each motor phase is required. in the case that only one phase current in two phase mode or one current value at all in three phase mode can be acquired, no current regulation is done in this cycle. calculating the total current when all required phase current values are present, the first step is to calculate the total current through the motor. in two phase mode, the pythagorean theorem is used: in three phase mode, the calculation is slightly simplified by not using parks transformation but also the pythagorean theorem with all three phase currents: the resulting difference to parks transformation is a constant factor of . calculating the error after calculating the total motor current, the difference to the target motor current is calculated, resulting in the current error. tolerance band to avoid oscillation near the target current value, a tolerance band can be defined. current regulation will only be done, if the absolute value of the error exceeds the tolerance. the error will be set to 0 in this case. the p - parameter the error C or 0, if the error was in the tolerance band C is multiplied with the p - parameter (proportional gain) to calculate the correction value. correction of the pwm amplitude the correction value is added to the value of the pwm amplitude. before setting the new pwm amplitude, the sum is tested to be within certain limits. it must not be negative and it must not exceed the highest allowed value, which is 127 for two phase motors and 155 (127*1.2247, see above) for three phase motors. results out of these limits are changed to 0 for nega tive results and 127 or 155 for too high results. v a l i d s a m p l e p o i n t i n v a l i d s a m p l e p o i n t t w o p h a s e m o t o r - h a l f b r i d g e p o l a r i t y a t 5 0 % p w m ( z e r o c u r r e n t ) x 1 x 2 y 1 y 2 v a l i d s a m p l e p o i n t t h r e e p h a s e m o t o r - h a l f b r i d g e p o l a r i t y a t 5 0 % p w m ( z e r o c u r r e n t ) u v w i n v a l i d s a m p l e s c a n o c c u r a t h i g h a m p l i t u d e s w h e n t h e p o l a r i t y c h a n g e s b e f o r e t h e c o n v e r s i o n i s c o m p l e t e d
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 25 copyright ? 200 9 trinamic motion control gmbh & co. kg figure 9 - TMC332 current regulation on two phase motors figure 10 - TMC332 current regulatio n on three phase motors in the application the measured current for each half bridge can be read out via both current registers ( $0b and $0c ), where register $0b contains the currents for all three bridges of a three phase motor or the first three bridges of a two phase motor (u /x 1 , v /x 2 , w /y 1 ) and register $0c contains the current from the fourth half bridge used for two phase motors (y 2) , the measurement error flags and the calculated total current. the current at a given measured value can be calculate d with this formula (r2 is the resistor at the comp_adc pin and c is the capacitor to ground) : i = ( 2 * i_ / f clk ) * 3.3v / (r 2 * c * r sense ) i_ denotes the current value of either one p h ase ( i_u , i_v , i_w or i_y2 on two or three phase motors ) o r the calcu lated absolute current ( i_abs ) for two phase motors. to calculate the absolute current of a three phase motor, a the total current has to be divided by sqrt(3)/sqrt(2) = 1.2247 : i total_3phase = ( ( 2 * i_abs / f clk ) * 3.3v / (r 2 * c * r sense ) ) / 1.2247 the limits for these values are - 12 4 to 12 4 for the phase currents, 0 to 12 4 for the total current with two phase motors and 0 to 15 1 for three phase motors. a value of +/ - 127 as single phase current means the current is higher than the valid measuring range a nd the pwm - amplitude is reduced with current regulation. absolute current values higher than 124/151 can occur in cases of resonance or high b ack emf , e.g. when the motor is stopped with high deceleration. to calculate the current setpoint value for the c urrent regulator, the formula needs to be rearranged : targ_curr 2phase = i max * r sense * r 2 * c * f clk / (2 * 3.3v ) targ_curr 3phase = 1.2247 * i max * r sense * r 2 * c * f clk / ( 2 * 3.3v) best regulation resul ts can be achieved with a setpoint at about 80 . t he sense resistors and the rc components should therefore be chosen depending on the desired motor current. if the limit - flag in register $0 c is set ( bit 12 ), the current regulator could not reach the current set in register $ 8c with the given pwm_ampl lim it . 9.5.1 additional notes the following order should be followed when enabling the current regulator to prevent malfunctions: - set the tolerance and the p - parameter - set the target current and the enable bit of the regulator - increase the current limit ( pwm_ampl ) during regulated operation when using gate drivers that can be disabled (e.g. the tmc603), the TMC332 does not notice a disabled driver but measures no current, which makes the regulator raise the pwm amplitude. when a d c f r o m r s e n s e x 1 a d c f r o m r s e n s e x 2 a d c f r o m r s e n s e y 1 a d c f r o m r s e n s e y 2 m u x m u x p w m a m p l i t u d e p - p a r a m e t e r t a r g e t c u r r e n t l i m i t i n g 0 x 1 2 7 t o l e r a n c e | x | t o l e r a n c e 0 | x | > t o l e r a n c e x t o p w m g e n e r a t i o n f r o m c o n t r o l l o g i c ? ? ? ? 2 x 2 x x a d c f r o m r s e n s e u a d c f r o m r s e n s e v a d c f r o m r s e n s e w p w m a m p l i t u d e p - p a r a m e t e r t a r g e t c u r r e n t l i m i t i n g 0 x 1 5 5 t o l e r a n c e | x | t o l e r a n c e 0 | x | > t o l e r a n c e x t o p w m g e n e r a t i o n ? ? ? ? 2 x 2 x x 2 x
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 26 copyright ? 200 9 trinamic motion control gmbh & co. kg the driver is enabled again, the curr ent can be too high for a moment until the regulator has lowered the pwm amplitude again. with the tmc603, an overcurrent condition can occur. this can be avoided by setting the target current to 0 before disabling the gate driver and enabling the gate dri ver before setting the target current to the previous value. 9.5.2 example first the target current value has to be calculated using the formula above. using a t wo phase stepper motor, a target current of 0.5 a ( absolute value) should be achieved with the tmc33 2 evaluation board, which has the following resistor and capacitor values: r sense = 0. 1 ohm, r 2 = 150 kohm, c = 1 n f, f clk = 16 mhz. targ_curr = 0.5 a * 0 .1 ohm * 150 kohm * 1 n f * 16 mhz / 3.3v = 18 (rounded) now the regulator can be set up. first the t olerance and the p - parameter are set up with the datagram $8 d 0 2 00 2 0 which means that the pwm amplitude is kept as long as the actual current and the target current differ no more than 12.5% of the target current and that the difference is multiplied wit h ( $00 2 0 / 4096 ) = 1 / 128 = 7.8125*10^ - 3 and added to the actual pwm amplitude when the difference is greater than the tolerance . next the target current value is set and the regulator is enabled with the datagram $8c 00 01 12 . t he $01 is the enable bit for the current regulator and the $ 12 is the value calculated before ( 1 8 ) in hexadecimal . now when reading out the second current register one might see the limit bit set ( $0c 00 00 00 - > $00 xx 1x yy with yy being lower than the previously set pwm amplitu de limit ) , which means that the regulator cannot reach the target current with the actual maximum pwm ampl itude. t he maximum pwm amplitude can be set to $ff (by sending $86 00 00 ff ) now. 9.6 automatic micro - / full step switching (address $0e) a better perform ance with higher speeds can be achieved with full stepping. to avoid the disadvantages of full stepping in low speeds the best way is to switch from micro stepping to full stepping at a certain velocity. this can be done by the microcontroller or even bett er automatically by the TMC332. the micro - / full step switching can be parameterized with register $8e. to enable full step mode permanently , the enable permanently bit (bit 17) and the current limit fs_targ_curr ( bits 12 ... 8) have to be set . to calculate the current limit parameter (in the range from 0 to 31) this formula can be used: fs_targ_curr = i max * 32 * r sense * (r 1 + r 2 ) / (3.3v * r 2 ) o n the eval b oard , the resistor values are r 1 = 1 m ? , r 2 = 150 k ? , r sens e = 0. 1 ? resulting in a maximum current of about 4 .1 7 a. with the values used on the eval board there a difference of 1 of fs_targ_curr equals about 1 35 ma of current. for automatic switching, the automatic bit (bit 16), the fs_curre nt_ limit parameter and the fs_ threshold parameter have to be set . the fs_ threshold parameter describes the minimal time between two phase changes . the formula to calculate the needed value is : fs_threshold = f clk / ( 256*f fullstep ) there is also a hystere sis to avoid oscillating between micro - and full step mode when the step frequency is close to the switching point and has small variations. a good threshold with enabled current regulator is when the regulated pwm amplitude reaches 240 ($f0) with the nee ded torque applied on the axis. if the motor has resonances in microstep mode at lower speeds, the threshold can be set at a lower point to avoid these resonances. 9.6.1 additional notes the chopper_mode bit defines how the bridges are controlled during full st ep choppering. the bridge connecting the coil to the supply voltage is choppered to limit the motor current. if the chopper_mode bit is 0, one end of the coil is left floating while the other stays connected to gnd , if the bit is 1 both ends of the coil ar e connected to gnd .
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 27 copyright ? 200 9 trinamic motion control gmbh & co. kg figure 11 shows the theory of chopper operation on one coil of a two phase motor. when driving a three phase motor in full step mode, the single motor coil would be replaced by two connections of the motor while the third connection is floating (neither the upper nor the lower transistor are on). figure 11 : full step chopper modes 9.6.2 example a two phase stepper motor with 200 steps per revolution should be switc h ed from micro - to full stepping at 150 rpm. 150rpm equal 30000 full steps /min or 500 full steps /s , so 16000000 / ( 256 *500) = 125 has to be set as fs_threshold . 9.7 calculation of r otational speed the rotational speed of the motor when applying a given micro s tep frequency can be calculate d with this formula: v = f s * (phi/1024) * (fs p /fs r ) v: rotational speed in rps f s : micro step frequency in steps per second phi: the phi_sum parameter (see 9.2 micro step width ) fs p : the number of full steps per electrical period, 4 for two phase motors, 6 for three phase motors fs r : the number of full steps per revolution of the motor 9.7.1 example for high rotational speeds the following values are the results from tests w ith the TMC332 eval board (24v motor voltage) . the speeds can differ with other motors C even of the same type C and of course with different transistors. t he usable torque at such high speeds is low. trinamic qmot qsh 4218 - 41 - 10 - 035 parameter value d atag ram tolerance 12.5% $8 d 0 2 00 1e p_parameter 30/4096 current regulator on ( r ) 1 $8c 00 01 3 2 targ_curr 50 full step chopper mode ( d ) 0 $8e 01 06 4 0 automatic switching ( e ) 1 fs_targ_curr 6 fs_thr 64 pwm_ampl (limit for regulator) 255 $86 0 1 0 0 f f phi_int 64 $84 00 00 40 phi_frac 0 $83 00 00 00 + v m + v m r s e n s e 2 r s e n s e 1 + v m + v m r s e n s e 2 r s e n s e 1 + v m + v m r s e n s e 2 r s e n s e 1 n o r m a l o p e r a t i o n c h o p p e r _ m o d e = 0 c h o p p e r _ m o d e = 1
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 28 copyright ? 200 9 trinamic motion control gmbh & co. kg the settings on the tmc428 are: p_mul = 200; p_div = 7; pulsediv = 2; rampdiv = 3; acceleration = 4; velocity = 1750 with these settings , a speed of approximately 8000 rpm is reached. 10 notation of n umber systems decimal numbers are used as usual without additional identification. binary numbers are identified by a prefixed % character. hexadecimal numbers are identified by a prefixed $ character. so, for example the decimal number 42 in the decimal s ystem is written as %101010 in the binary number system, and it is written as $2a in the hexadecimal number system. in binary and hexadecimal numbers x is used as dont care, so %1100x010 can be %11000010 or %11001010 or $4x can be anything from $40 to $4f . dont care means that either the TMC332 ignores the state of t he bit ( s ) or the state is unimportant for the explanation of a reply from the TMC332.
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 29 copyright ? 200 9 trinamic motion control gmbh & co. kg 11 revision history version date (initials) comment 1.00 november 3rd , 2008 (sl) first published versi on november 4th, 2008 (ll) package image updated 1.01 november 26th, 2008 (sl) added formula for current calculation december 1 1 th, 2008 (sl , ll ) december 17th, 2008 (sl, ll) core voltage within feature list corrected to 1.5v (section 1 , page 1 ), headline packaging TMC332 (section 5.1.1 , page 7 ) , tmc454 updated with tmc457 within drawing outline figure 4 , page 9 . outline tmc457 with TMC332, figure 4 , page 9 corrected (spi interface between tmc457 and TMC332) 2.00 march 2 0th , 2009 (sl) march 23th, 2009 (sl) april 8 th , 2009 (sl) changes for TMC332 v2.00 documentation for register $07 and $0e (read access) different current calculation for three phase motors added current regulator modifications (tolerance and p - parameter registers) updated figures 5 and 6 with changed va lues , removed encoder flag output from datasheet (has been removed from chip) 2.01 april 17th, 2009 (sl) description for sc_pd_amount ( 7.6.1 ) determination of bbm_dly parameter ( 9.3 ) 2.02 september 10th, 2009 (sl) changed pins m11, l10 and l12 to ground connection ( table 5 - 1 ) 2.03 september 17th, 2009 (sl) current controller description 2.04 november 9th, 2009 (sl) functional description of current measurement an d regulation ( 9.5 )
TMC332 data sheet (v. 2.0 4 / november 9 , 2009) 30 copyright ? 200 9 trinamic motion control gmbh & co. kg please refer to www.trinamic.com for updated data sheets and application notes on this product and on other products. the tmctechlib cd - rom including data sheets, application notes, schematics of evaluation boards, software of evaluation boards, source code examples, parameter calculation spreadsheets, tools, and more is available from trinamic motion control gmbh & co. kg by request to info@trinamic.com


▲Up To Search▲   

 
Price & Availability of TMC332

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X